//
//  ANBasePageViewController.h
//  Muck
//
//  Created by 张威 on 2018/8/8.
//  Copyright © 2018年 张威. All rights reserved.
//

#import <UIKit/UIKit.h>

@class ANBasePageViewController;

typedef NS_ENUM(NSInteger, ANBasePageViewControllerDirection) {
    ANBasePageViewControllerDirectionForward,//is right-to-left 正向切换
    ANBasePageViewControllerDirectionReverse//is left-to-right  反向切换
};

@protocol ANBasePageViewControllerDelegate <NSObject>
@optional
///返回当前显示的视图控制器
- (void)basePageViewController:(ANBasePageViewController *)pageVC didFinishScrollWithCurrentViewController:(UIViewController *)viewController;
///返回当前将要滑动的视图控制器
-(void)basePageViewController:(ANBasePageViewController *)pageVC willScrollerWithCurrentViewController:(UIViewController *)ViewController;

@end

@protocol ANBasePageViewControllerDataSource <NSObject>
@required
- (NSInteger)numberViewControllersInBasePageViewController:(ANBasePageViewController *)pageVC;
- (UIViewController *)basePageViewController:(ANBasePageViewController *)pageVC indexOfViewControllers:(NSInteger)index;


@end


@interface ANBasePageViewController : UIViewController

///刷新
- (void)reloadPageViewController;

@property (weak, nonatomic) id<ANBasePageViewControllerDelegate> delegate;
@property (weak, nonatomic) id<ANBasePageViewControllerDataSource> dataSource;

@property (nonatomic, strong, readonly) NSArray *viewControllers;
@property (nonatomic, strong, readonly) UIViewController *currentViewController;

- (void)setViewControllerIndex:(NSInteger)index direction:(ANBasePageViewControllerDirection)direction animated:(BOOL)animated;


@end
